package com.ctosb.classviewer.clazz.attr;

import com.ctosb.classviewer.ClassReader;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class InnerClasses_attribute extends Attribute_info {

    private short number_of_classes;
    private InnerClass classes[];

    @Override
    protected void doParse(ClassReader classReader) {
        this.number_of_classes = classReader.readShort();
        classes = new InnerClass[number_of_classes & 0xffff];
        for (int i = 0; i < classes.length; i++) {
            classes[i] = new InnerClass().parse(classReader, getClassFile());
        }
    }
}
